major upgrades to testapp.py