Modified algorothm and reduced complexity for combinations