adding changes to Chapter 2 exercise