Calculating the slope of a linear function