lots of small changes to tri_driver.py