Implemented map_for_each