clean up version of experiment, removed almost all the scripts and converted them to functions