added flexibility to index type.