code for week 1 assignment