Adding a timeout to geolocation (with formatting fixes where necessary)