Code Review changes to script