Added helper functions for hex conversions