Base code for exam q3