moved over attenuation function as well