Modified code for setting up a map.