Refactoring

Refactored to use placeUnit method in the generateMap method.