Added Docstring for slope function