Implemented programming question of Week 3