Reimplemented 3D plotting