Imported work in progress from my working code base