Altered the lexer to have an appropriate top-level function.