Added a new function to find the correct PossiblePaths and solved minor
bugs