Implemented funtions for using a 1D array as though it were 2D.