Added functions to convert between 1d and 2d arrays.