bugs fixed.  works.  but probably not fully thread safe.  needs rework.