Completed Assignment 2 Solution Code