basic rb-tree implementation seems to work