Refactored Day 3