Assignment 2 solution

Added my own code and comments