Adjusted buffer length so buffer ends at the end of the ramp.