Committed original code

For diff purposes, mainly. But this is what wjrogers originally wrote.