Changed implementation to use the built-in hex conversion