Updated geolocation code