Let's start from the CL code.

The most important part.