binary io almost done

Writing works fine
Reading has issues