made some progress with BinaryWriter