adding progress bar; moved general scripts to GlobalState