Code for Assignment 1