Updates to week 9 code