add snprintf to convert decimal to hex