I think modify opt.counter not a good start.