solves ch4 folds exercises #3/#4 (pg.98)