solution to problem 2
solution to 2