Implemented createIndex method