Updated with spherical coordinates