Added loop counter.