implementation of red black tree