modified the heuristic