update hex calculation