Well that was a lot of work ... and const correctness wrangling.