Added some comments to explain things.