Solution to Week 2 challenges