Increased performance of bettiNumbers()