finished part1 for hw3