solution to ex5