Starting to solve Problem 4
Solution for Problem 4