new heuristics for flags (contours)