Optimization complete

Replaced a list with an unordered map, no slowdown to be seen