ch5 examples & exercises compiled