Solution for Assignment 4