I'm not sure how I mangled that last patch as it compiled and ran OK. Anyway here is the updated patch.