Switched var to member var

Removed the counter from the class variable and made it a member
variable in the covariance method otherwise you can't all the method
more than once since the var is not being reset.