Solution for Assignment 2