fixed ch10 ex21; modified ch17 ex1