pulling in the useful parts of Daniel's changes
4 files changed