Added lambda function to A* for heuristics.