Added the map, made the map code more scalable