When multiple peptides of different lengths or scaffolds are considered during BO, peptides are first clustered and separated into distinct SequenceGA optimization pools (as described earlier). This allows multiple GA optimizations to run in parallel, but also maintain structural diversity and avoid premature convergence to a single length or scaffold. Peptides are clustered based on a masked version of their HELM string. The masked version is obtained by replacing each monomer symbol in the HELM string by the unknown monomer symbol X, except if a monomer is involved in a connection (e.g. macrocycle). As an example, the following HELM string for peptide PEPTIDE1{E.L.I.N.E}$$$$ becomes PEPTIDE1{X.X.X.X.X}$$$$. Every peptide with the same length or scaffold will then have the same masked HELM string, allowing them to be gathered effectively within the same pool.