fixed minor bug from heuristic