targetid_simple.py: improved heuristics