v1.0.2
Added comments and tidied-up code formats.
For compability to v1.0, the code remains exactly the same semantic, with only a bit reordering of variables.
Code modifications are postponed to v1.1, the next version.
If you are familiar with v1.0 code, then this version is a good place to start.
If you are new to this repo, v1.1 may be more friendly.