param by value bugs--to be transfered to value by reference