adding problem 3, modified problem 2