created logic for logic_counter