write binary working