First version of script, how off of gist.