write to hex working