Some code grouping and commenting to explain program flow.