added goal checking and integrated fringe-search