exercise11 added some functions modified