Methods are provided for purifying peptides and proteins by incorporating the peptide or protein into a diketopiperazine or competitive complexing agent to facilitate removal one or more impurities, i. In one embodiment, the beamsplitters can be configured to produce one or more split beams of light that can emerge at angles other than 90\xb0 to one another. The method further comprises moving the probe along the surface while varying chamber pressure to flex the membrane to accommodate the surface.