Infer logx without sorting :)