initial version of lecture 4