how a gold mining plant work