fix bug where i was reading bits instead of bytes