Added Docstring to on_slope function