Updating some code that was correct in the script, but had gotten lost in the finish product of the code