merge code from HAC development