ah calculation