Array2Dto1D fixed