added soltuion for problem 2