complete change in approach
  - necessitated a rewrite, but many bugs with small binary streams fixed
  - added tests