modified printSumPaths() so it can stop in a non-leaf node