Refactored few for loops in map
Fixed conflict