Solution for Week 2 Assignment