This is my solution to assignment 2