Implement a CoordMap data structure to manage the coordinates
Shift away from nested for loops.

Instead of iterating through nested for-loops, iterate through the keys
of the coordMap object.