Implementing the first part of the tutorial.