altering code for a function