Converted grid pointer array to 1D