Tweaked the 3d sweeping program