first version of event counter