Added some comments to explain some peculiarities.