Convert basic Grid class to Matrix2D