converted completely to hex, added legacy support