>>815
mCounter = (mCounter + 1) % length;