prob heuristics code refined