create index method