Completed problem 2, added problem 3