sort indices