SUM and AVG in mathematical expressions, trying to fix parenthesis