updated codes from week 8