key value sort added; indexed reduction added