implemented a new trail-finding method (does not work)