adding missing code to ch12