Added some code to index creation