first attempt at lexicographic printer
changed lower sort to lower reverse to fix algorithm