isolating A_star for testing