Change loop to map.