Nugget Problem refactored