progress on keypatching, up to the point where we can debug