hex2decimal and the reverse