update for assignment2 problem1