Completely untested.  May not even compile.