In general, these functions all look right, but they're quite confusing to read. Knowing that this is an atomic tuple of counts helps in reading the code, but usage of the static in the code below is incredibly opaque. I'll add specific comments below.