Create missing_term.py

Improved version of missing_term.py