output: use count instead of flag