before change to 2d array