Made height calculation only do to new branches up. Recursion wins again! Adding node->height = getHeight(node); makes it update only the needed ones.