week 9 final code (hopefully)