finished js file, added geolocation