Comet impacts and chemical evolution on the bombarded Earth