Completed both exercises for question 2