fixed the stretch code with some help from filip. small formatting changes.