Add count_to_flux routine