Added and completed problem 6