completed best first search with errors and bugs