fixed up 3d plotting