bug fixes; now fully working
added binary file output; bug fixes