This returns CapCounter[0] which is only ever incremented in this code.  Needs a reset somewhere sensible.  Maybe in the trigger() function.