A model for the function of bacteriorhodopsin.