code for week 3, pt. 1