This implementation is a bit restricted, the <code>count</code> is more general and flexible, it allows you to define your own condition.