Added Slope method which is crucial to DFS