updated to use sscanf for automagical hexdec