Wrote possible solution to assignment 2.