Updated script with comments