The structure of carboxylic acid and amide groupings