fixed slope calc for slope_vals