adding the for loop to index.php