moved old bin2hex, hex2bin functions into new code