Implemented a treemap, did lots of cleaning up