problem 2 code