merged jeff's code in