findLongestPath is now functional