logic ordering