changes to lecture 5 and 6