Having trouble iterating through the map...
Algorithm works for some cases, I need to develop a more rigourous way of testing.