Now using hashmaps, should be faster