implement simple counter