timepulse synchronization and cleaner "new_code.py"