Assignment 3 Problem 1 first pass