Added binary writing support