refine the heuristic