15 solution refactored