added lec6 stuff