ordering in pairs