I will describe a statistical model of aligned DNA sequences, from multiple species, containing shared modules. The model incorporates the tendency of certain TFs' binding sites to appear adjacently in a module. It accounts for evolutionary conservation of binding sites. It also requires no information about the number of TFs acting on the sequences, or what patterns their binding sites follow: these questions are answered by the inference procedure, as part of the model. If something is known in advance about TFs and their sites, as is usually the case, the model makes use of that information in a natural way, while still allowing for new, unknown TFs. The core of the inference involves sampling posterior path trajectories in an infinite-state generalized hidden Markov model; I will explain what this means and how it is done. Results on real multiple alignments, some large, will be presented.