More comments and named intermediate variables in the sample code.
Describe what this does.
Also show the sample code inline in the documentation.