Added code for ex4
Added sample code for ex5