initial implementation for java counter