implement statistics mode