add function to convert binary string to integer