tidied up notes for lecture 13