ex4 and 5 done