how do machines get metal out of ores