Added two versions of problem 2