Better binary_to_number function