Tidying up index code adn commenting