updated ch3 exercise code
added solution to Ch4 exercise