Add problem 4 solution