A quantitative analysis of the factors controlling the structure of AH2 and AH3 molecules