Added some comments to make things more obvious.