prepare to sort variables