pulling in code from Jonah's updates