add an index method