rebuilt path-finding