rewrite lexicon.py