refactoring skeleton method for aStar.searchFor