added lend and return function