Added slope generation algorithm