Tested 3d functions