updated lecture5 notes