Feature/optimizedmatrix

Added the Sum optimization - if left or right are Sums, Sum of all of them can be done in one groupBy.