buffer in, buffer out.
more tests
refactoring