added documentation to index method.