Added code for part 2 of the tutorial.