Now partially simplifies SUM functions