added counting functionality
Added counting functionality to button click