replaced tap with map.with_index