Counter with setters and getters