Code for Assignment 5