speed up a bit by using less iterations and a different threshold