made some error checking and added more test cases in mainRBTree