mining processing plant how it works