added flagcounter