updated codes from week 7