added rbtree stuff back in