a bit of optimization op hex_a