moved map code into its own js file