refactored 15 solution