added function to count number of incomplete items