get2dFrom1d function

1D-indexing to 2D-indexing