renamed some stuff. wrote the meat of the script.