sorting mco output and enabling flatten