paste some code from ch7