Refactored example_counter slightly.