Refactored 5th challenge