ASSIGNMENT 2 WRITTEN SOLUTION