Added lines to convert 1D array to 2D array