Finding the acceleration of a system I think I'm missing something in my working of this mechanics question. The working seems to short but I don't know what else to do.

Box $A$ of mass $10kg$ rests on a smooth horizontal table. It is connected to one end of a light inextensible string which passes over a smooth pulley at the same height of the box. Box B of mass $8kg$ is attached to the other end of the string.
Find the acceleration of the system and the tension in the string.

I did:
Tension $ =8g =78.4N$
Then, by $F=ma$,
$78.4 = 10a$, so $7.84 {ms}^{-2} = a$
 A: $F_A,F_B$ forces on $A$ and $B$ resp. $T$ tension, $a$ acceleration.
1)$ F_A = T = m_A a $, 
2) $ F_B =m_B g -T=m_ B a.$
Add 2)+1): 
$m_Bg=(m_A+m_B)a$;
$a= \dfrac{m_B}{m_A+m_B}g;$
$T=\dfrac{m_A m_B}{m_A+m_B}g$.
A: Your calculation is incorrect. In this situation the tension shall be $\frac {40}{9} g N$ and the acceleration $\frac{4}{9} g$.
The equations will be -
Total mass * Net acceleration of system = Total downward force 
and,
Net downward force - Tension = Mass of B * Acceleration if B
Mathematically,
$$ 18.a = 8.g$$  and,
$$8g - T = 8.a$$.
Subsisting the value of $a$ from the first equation to the second shall give you $T$.

To gain a better understanding for such problems, note that since the the two bodies are connected to form a single system, they must have the same acceleration, $a$. This acceleration shall be the ratio of the total force acting upon and the total mass if the system (see the first equation), as stated by Newton in his second law.
Now, notice that the same reasoning about Newton's law holds individually for the two bodies. (See second equation with regard to body B). It may be helpful to remember that the since the table is smooth, the only force acting on body A, is the tension in the string.

Note that drawing free body diagrams, is in general, a great help in such problems and shall allow you to quickly go through whatever reasoning (like the above) is required by the physical situation.
A: Displacement of the two masses shall be the same, so is speed and so acceleration.
On one side you have the equilibrium $mg-F=ma$, on the other $F=Ma$: two equations in the unknowns $F$ and $a$.
