Second level: recursive structure formation Secondary structure elements often form in pseudoknot loops, resulting in a recursive pseudoknot. After finding stable core H-type pseudoknots, the three loops L 1 , L 2 and L 3 are examined for likely secondary structure elements. It is a valid assumption that the three loops form recursive elements independently and can be treated separately (Figure 4) . From an algorithmic point of view, it is efficient to find recursive structure elements using a MWIS calculation (Supplementary Algorithm 3) . Given a core H-type pseudoknot, three candidate lists hold all possible secondary structure elements from dictionaries D s , D L s and D M s contained in each of the loops L 1 , L 2 and L 3 . A standard MWIS calculation with free energy weights for each of the three lists returns the set of secondary structure elements with best local free energy for each loop. The results are combined to form a recursive H-type pseudoknot.