Getting the compressed tree system to work. Needs to fix the edge cases.