Figure 1: The structure of the sample code