half done changes to trigger.py to save raw data