add function to read binary file and examples, simplify headers included in examples