Added some code to control the map stuff