The generation of molecular diversity