sort variables in a program lexicographically