ordering strings of varying length lexicographically