Updated generate.py, replay.py and replay.sh