Code from the first three chapters of the tutorial