index creation feature, need to make it cleaner now