Code for Comprehensive Assignment Question 1