changes to HAL code