Generalized from slope to slope
First recursion working correctly