small tweaks to lecture 8