red black tree refactor verified