Update index.php

Improved code