Completed assignment 3 problem 1