Code for the Assignment 2 project