Logic order correction