reworked heuristic