Added the solution for actual problem 4.