wrote recursiveSum method