function based on  where they use a threshold density difference of .03 kg/m^3