added loop for map