Added support for lexical order. Closes #1