notes from lec 3,4 and rec 2