Maybe diff is messed up, but looks like there are two copies of this function?