Solution for problem two.