added logic to detect whether a paritition contains the end.  This provides us with a path that always has a solution.
removed logic to continue to find a path if a path with no end was previously created since we now always create a solution.