Assignment 2 solution

Assignment 2 solution, passed tests