Add exercise code for answer (a) and (b)