Source: http://www.csc.villanova.edu/~map/1051/f15/12arraysIIExercise2D.pdf