use function to estimate slope.
use function to estimate slope.