working on the map loop