added binary file output