updating everything from problem 3