Cleaned up SR785.py, data writing routines