finished exercises from ch04