Refactor Problem 4
Problem 5
Problem 6