implmentation of issue #22 using count data as covariates