finish ch8
copy code over to ch9