added comments to end of script closing brackets for clarity