updated codes from week 9