Heuristic improved