add some code for binary