The function of the pilli in bacteria is to: