implemented a star search algorithm