Updated AQH function