Try to make findAllPaths tailrecursive.