code for maintaining SubtreeSize