added scripts for logging and replaying