This section explains the ideas behind individual parts of the code. The source code has been divided into numbered parts, and the following subsections explain each of these parts.