Added some comments to index.php to clarify what is happening.