scripts for automating an experiment, there are some bugs