add length method for Accumulator