better funtion names, tweaks to the functions, and a better 'run' script