improve exercises from chapter13