Added methods to convert 2D and 1D arrays.