wrote a doc_string for index function