My solution to week 3 programming assignment.