Already tested for unordered inputs