Code for Tree Stability Framework