14 refactored last solution