almost generating a hexadecimal number