Merge with Haley's latest code