how a gold mining machine works