implemented ex5