I am confused about how is runnerTime += times[outer][inner] calculating the row sum. I looked up more information online, someone said that if you want the sum of the column only, then you will need to do this: int colSum =new int[times[0].length]; then inside the for loop, add colSum[inner]+=times[outer][inner].