Made a_star_search about three times faster.