Explain the overall structure of the script.