draft a-star algorithm