more edits based on testing, mostly messing with variables to make this script easy to moddify and maintain