Merging master
Changed this to work in 3D