implemented a small part of rbtree insertion and added a to validate the
tree's state