Working version of Splay tree. Needs optimization for text3 and 5.