changed the map_tuples_to_fields method to actually return the created map