implemented heuristic