G.3. Complete Code

Now, it's time to put everything together!