more tweaks to lecture 9