chapter10 exercises in chapter9 improved by handle class