add function to read binary file and examples