added print binary to file method