completed part2 of assignment1