start writing index management functions