Completed question 3 in assignment