significantly spead up count total reads function