removes impurities