Assignment 3 Problem 1 final with comments