minor script editing and added comments