Added counting feature