Work for hw2 part1.