more input checking, and python_reference