basic counter working