what are the byproducts of producing metals through mining