problem 2 edited second answer