Added rank to binary search tree