updated redblacktree.py implementation