Fixed bug where last node in the tree's next pointer did not point to null. Added support for using hash maps