a correct sharedIndicies formulation