That makes it a little more complicated. You'll want an array for your total counters then too. I'd suggest you read the chapters in your book covering arrays and for loops until they make sense. Keep in mind in your examples, index i accesses the row and index j access the columns. j should only loop over the columns you're interested in. Therefore it won't start at 0.