2d Matrix To 3d