maybe put n and startRanks in getPartitions?