A model of horizontal gene transfer and the bacterial phylogeny problem