Consider the following algebraic steps:
$$ F - (M_1 a + \mu_k M_1 g) - \mu_k M_2 g = M_2 a $$
$$ F - \mu_k M_1 g - \mu_k M_2 g = (M_1 + M_2) a $$
$$ a = \frac{F - \mu_k M_1 g - \mu_k M_2 g}{(M_1 + M_2)} = \frac{80N - 16.17N - 17.248N}{31kg} $$
$$ = 1.5 \tfrac{m}{s^2} $$
Could someone walk me through the process they did to solve for $a$ here? Those parentheses are really throwing me off; I don't know what to do with them.
$$\begin{align}F \color{orange}{-} (m_1a+\mu_xm_1g)-\mu_xm_2g &= m_2a\\ F \color{orange}{-} m_1a\color{orange}{-}\mu_xm_1g-\mu_xm_2g &= m_2a \\ F \color{red}{- m_1a}-\mu_xm_1g-\mu_xm_2g &= m_2a\\ F -\mu_xm_1g-\mu_xm_2g &= \color{red}{ m_1a} + m_2a \\ F -\mu_xm_1g-\mu_xm_2g &= \color{blue}{(m_1+m_2)}a\\ \frac{F -\mu_xm_1g-\mu_xm_2g}{\color{blue}{(m_1+m_2)}} &= a.\end{align}$$