Fixing tree
Fixing dirtied index, re-adding api