worked on term.py