completed the getLocation function in Geolocation