Implement full Algorithm X for Algorithm L.
Implement full Algorithm X for Algorithm L.