Update index.php

Format code and improve comments