Code for Assignment 3