changed 3d array back to 2d array