Calculates Slopes