added counting controls