fixed an error and minor formatting issues in findPath