* used io.BytesIO like Andrew Miller