rbtree implementation. For practice.