implementred turn_iff