updated codes from week 2