wrote the return function code not tested yet