Moved to hashMaps, refactored tree generation