lab4: exercise6, 7 done