start of handling count data