added 3d functions: not tested, but should probably work