add I/O to docs
bugfixes, update test