Change for loop to map.