Sums rows and sums columns of an array