problem 2 first attempt