chapter example is working and I have added tests.