debugged the map builder