Simplification of the code for slopegraphy.py