Working Version. Accurate average counting.