Solved Week 7 assignment 6