Updated increment_counter to use dict_to_key