added solution to ch3 exercise