Assignment 2 Programming Solution