Made a lot of optimisations
Changed some maps to unordered