updated codes from week 5