first version of lecture 4