Code for week 7