Cleaned up and optimized RTree code and started working on overflow treatment