updated codes from week 6