privatized counter and added checker method