rewrote (match string) and (lex).  also debugged them a bit.