Changed 1D array to 2D array