Completed Ex3.