Correctly prints NxN matrix to the screen