added flipcount
added flipcount