Merged Bridget's latest code.