got 3D matrix working