working on subtree size calculation