solution to week 1 assignment