Modified timelapse.py