Hartl book example starting from Chapter 3