Created toDec and toHex to deal with hex to and from conversions