applied simple loop to index.php