First version with create index