finished lec7, do not know if compiles