Prelim version that compiles on MSVC