Completed Coding for Assignment 2