use 0 as EmptyIndex.