reimplemented bin reader