first draft of lecture code