finish chap6 exercise; add rbtree implementation