fixed findPath and assorted functions to return nodes