committing code for ch8 ex1