very raw version of lect 4-8