fixed a problem with the z direction, now 3d works