rewrite binary fns again