Comments added for entire script explaining purpose and reasoning.