changed vaiables to references in Point3D