Completed problem 2
Updated problem 1