Changed TreeMap to hashmap, and implemented hashcode, made the path play
to work.