added --count option