updating with all of problem 1