added ECM, but it's extremely slow (or wrong)