Slope calculation improved.