updating with half of problem 2