Hello, my head hurts. I'm trying to reduce this:

$\displaystyle M=A(B+C+B\bar{C})+ B(A \bar{C}+AB)+ BC+AB\bar{C}+(\bar{A}+C)$

the last part $\displaystyle (\bar{A}+C)$should also have a \bar around the whole thing but i couldnt get that to work in tex.

I got this far:

$\displaystyle AB + AC + BC + AB\bar{C} + AB\bar{C} B\bar{A}C + BAB + A + \bar{C}

= B(A + C + A\bar{C} + A\bar{C} + \bar{A}C + AB) + AC + A + \bar{C} $

But im not sure if this is correct, if it is, hints for further reducing is very welcome