findPath function

Finding paths