change the order of CMP_OUTPUT and CMP_INPUT