wooohooo sortings and rewritings