added method to convert a hexadecimal string to binary