Added ability for script to update at regular intervals and for output directory to be changed.