Implementation simulates 2D array with 1D array