D’Alembert’s Ratio Test for Convergence of Series

D’Alembert’s ratio test is the first tool I reach for when I need to decide whether an infinite series converges or diverges. It compares each term to the one before it, and the moment that ratio settles below 1, the series is convergent. If you’re working through real analysis or second-semester calculus, you’ll lean on it more than any other convergence test, because it cuts through series built from factorials, exponentials, and powers where comparison and integral tests turn into a slog.

Jean le Rond d’Alembert published this test in 1768, and it was the first ratio test ever stated for series convergence. Almost 260 years later it’s still the default on every analysis syllabus, from Rudin to Bartle. I’ll give you the clean statement, the five-step method, four worked examples (including the case where the test quits on you), the mistakes that cost marks, and a refreshed FAQ. Straight quotes only, no fluff.

Statement of D’Alembert’s Ratio Test

A series \( \sum u_n \) of positive terms is convergent if, from and after some fixed term, \( \dfrac{u_{n+1}}{u_n} < r < 1 \), where \( r \) is a fixed number. The series is divergent if \( \dfrac{u_{n+1}}{u_n} > 1 \) from and after some fixed term.

D’Alembert’s test is also called the ratio test for convergence of a series. The two names refer to the exact same criterion, so if your textbook says “ratio test” and your professor says “d’Alembert’s test,” they mean this.

Theorem

Let \( \displaystyle \sum_{n=1}^\infty a_n \) be a series of real numbers in \( \mathbb{R} \), or a series of complex numbers in \( \mathbb{C} \).

Let the sequence \( \{a_n\} \) satisfy:

$$\lim_{n \to \infty} \left| \frac{a_{n+1}}{a_n} \right| = l$$

  • If \( l > 1 \), then \( \displaystyle \sum_{n=1}^\infty a_n \) diverges.
  • If \( l < 1 \), then \( \displaystyle \sum_{n=1}^\infty a_n \) converges absolutely.
  • If \( l = 1 \), the test is inconclusive.

Here’s the same theorem as a decision table. I keep this exact mapping in my head during exams, because the only thing you do at the end is compare one number to 1.

Value of the limit \( l \)ConclusionWhat to do next
\( l < 1 \)Converges absolutelyDone. The series converges.
\( l > 1 \) (including \( l = \infty \))DivergesDone. Terms do not tend to 0.
\( l = 1 \)InconclusiveSwitch to Raabe’s test, root test, or comparison.

Alternative form: The series \( \sum u_n \) of positive terms is convergent if \( \displaystyle \lim_{n \to \infty} \dfrac{u_n}{u_{n+1}} > 1 \) and divergent if \( \displaystyle \lim_{n \to \infty} \dfrac{u_n}{u_{n+1}} < 1 \). This form flips the fraction so you avoid nested fractions, which keeps the algebra cleaner in many problems. You’ll see this used in the worked examples below.

My free Foundation of Analysis book covers the D’Alembert and convergence tests for series, with more proper examples and more. Get it to your email inbox now.

How to Apply the Ratio Test

The ratio test follows the same five steps every time. After you’ve done it a few times it becomes mechanical, and you can run it in under a minute. Here’s the process I use for every problem.

Step-by-Step Method

  1. Write down the general term \( a_n \). Identify the pattern in the series and express the \( n \)th term as a formula.
  2. Write \( a_{n+1} \). Replace every \( n \) in your general term with \( n+1 \).
  3. Form the ratio \( \left| \dfrac{a_{n+1}}{a_n} \right| \). Simplify as much as possible before taking the limit.
  4. Compute \( \displaystyle \lim_{n \to \infty} \left| \dfrac{a_{n+1}}{a_n} \right| \). This is where most of the algebra happens.
  5. Compare the limit to 1. If \( l < 1 \): convergent. If \( l > 1 \): divergent. If \( l = 1 \): the ratio test can’t help you, try another test.

The ratio test works best when the general term contains factorials (like \( n! \)), exponentials (like \( 2^n \)), or products of both. That’s because consecutive terms share most of their structure, so dividing \( a_{n+1} \) by \( a_n \) cancels nearly everything and leaves a clean limit. If your series only has polynomial terms (like \( 1/n^2 \)), the limit will almost always equal 1, and you’ll need a different test.

This is the same machinery behind the radius of convergence of a power series. When you apply the ratio test to \( \sum c_n x^n \), the limit comes out as \( |x| \) times a constant, and the inequality \( l < 1 \) hands you the interval of \( x \) values where the series converges. So this test isn’t just an exam exercise, it’s how you find where a Taylor series is actually valid.

Worked Examples

The fastest way to understand the ratio test is to work through problems of increasing difficulty. I’ve arranged these from straightforward to tricky, ending with a case where the test fails and you need a backup plan.

Example 1: Exponential Series (Divergence)

Test the series \( \displaystyle \sum_{n=1}^{\infty} \frac{2^n}{n} \) for convergence.

Here \( a_n = \dfrac{2^n}{n} \) and \( a_{n+1} = \dfrac{2^{n+1}}{n+1} \).

$$\left| \frac{a_{n+1}}{a_n} \right| = \frac{2^{n+1}}{n+1} \cdot \frac{n}{2^n} = \frac{2n}{n+1}$$

$$\lim_{n \to \infty} \frac{2n}{n+1} = \lim_{n \to \infty} \frac{2}{1 + 1/n} = 2 > 1$$

Since the limit is 2 (greater than 1), the series diverges. The exponential \( 2^n \) grows much faster than the linear \( n \) in the denominator, so the terms never shrink toward zero.

Example 2: Factorial Series (Convergence)

Test the series \( \displaystyle \sum_{n=1}^{\infty} \frac{n!}{n^n} \) for convergence.

This is the kind of series where the ratio test really shines. Here \( a_n = \dfrac{n!}{n^n} \) and \( a_{n+1} = \dfrac{(n+1)!}{(n+1)^{n+1}} \).

$$\left| \frac{a_{n+1}}{a_n} \right| = \frac{(n+1)!}{(n+1)^{n+1}} \cdot \frac{n^n}{n!}$$

Since \( (n+1)! = (n+1) \cdot n! \), this simplifies to:

$$= \frac{(n+1) \cdot n!}{(n+1)^{n+1}} \cdot \frac{n^n}{n!} = \frac{n^n}{(n+1)^n} = \left(\frac{n}{n+1}\right)^n$$

$$= \left(\frac{1}{1 + 1/n}\right)^n$$

$$\lim_{n \to \infty} \left(\frac{1}{1 + 1/n}\right)^n = \frac{1}{e} \approx 0.368$$

Since \( 1/e < 1 \), the series converges. Notice how naturally the number \( e \) appears here. This happens often when factorials and powers of \( n \) compete in the same term, since \( (1 + 1/n)^n \to e \) is one of the defining limits for \( e \).

Example 3: Parameter-Dependent Series (Mixed Result)

Test the series \( \dfrac{x}{1 \cdot 2} + \dfrac{x^2}{2 \cdot 3} + \dfrac{x^3}{3 \cdot 4} + \ldots \) for convergence, where \( x > 0 \).

We have \( u_{n+1} = \dfrac{x^{n+1}}{(n+1)(n+2)} \) and \( u_n = \dfrac{x^n}{n(n+1)} \).

Using the alternative form of the ratio test:

$$\lim_{n \to \infty} \frac{u_n}{u_{n+1}} = \lim_{n \to \infty} \left(1 + \frac{2}{n}\right) \frac{1}{x} = \frac{1}{x}$$

When \( 1/x > 1 \), i.e., \( x < 1 \), the series is convergent.

When \( x > 1 \), the series is divergent.

When \( x = 1 \), the ratio test fails (limit equals 1). We need another approach.

For \( x = 1 \): \( u_n = \dfrac{1}{n(n+1)} = \dfrac{1}{n^2} \left(1 + \frac{1}{n}\right)^{-1} \)

Expanding: \( u_n = \dfrac{1}{n^2} \left(1 – \frac{1}{n} + \frac{1}{n^2} – \ldots \right) \)

Take \( v_n = \dfrac{1}{n^2} \). Now \( \displaystyle \lim_{n \to \infty} \dfrac{u_n}{v_n} = 1 \), a non-zero finite quantity.

But \( \sum v_n = \sum \dfrac{1}{n^2} \) is convergent (p-series with \( p = 2 > 1 \) ).

By the limit comparison test, \( \sum u_n \) is also convergent when \( x = 1 \).

This example matters because it shows the full workflow: apply the ratio test first, then switch to a different test when the ratio test is inconclusive. You’ll see this pattern repeatedly in exam problems, and it’s exactly how the radius-of-convergence question is structured. The ratio test nails the open interval, and a separate test handles each endpoint.

Example 4: The Harmonic Series (Inconclusive Case)

Test the harmonic series \( \displaystyle \sum_{n=1}^{\infty} \frac{1}{n} \) using the ratio test.

Here \( a_n = \dfrac{1}{n} \) and \( a_{n+1} = \dfrac{1}{n+1} \).

$$\left| \frac{a_{n+1}}{a_n} \right| = \frac{n}{n+1}$$

$$\lim_{n \to \infty} \frac{n}{n+1} = 1$$

The ratio test is inconclusive. We know the harmonic series diverges (by the integral test or p-series test with \( p = 1 \)), but the ratio test can’t tell us that. The exact same limit of 1 shows up for \( \sum 1/n^2 \), which converges. That contrast is the whole reason \( l = 1 \) means “try something else,” not “maybe it converges.”

Common Mistakes to Avoid

I’ve seen students lose marks on these mistakes more than anything else related to the ratio test. Most of them are easy to fix once you know what to watch for.

Forgetting absolute values. The test requires \( \left| \dfrac{a_{n+1}}{a_n} \right| \), not just \( \dfrac{a_{n+1}}{a_n} \). For alternating series, skipping the absolute value gives you a negative limit, which makes no sense in this context. Always use \( |a_{n+1}/a_n| \).

Concluding from \( l = 1 \). When the limit equals 1, the test tells you nothing. It doesn’t mean “the series might converge.” It means the ratio test cannot determine convergence or divergence. Both the harmonic series (\( \sum 1/n \), divergent) and the Basel series (\( \sum 1/n^2 \), convergent) give \( l = 1 \). You must switch to another test.

Using it on purely polynomial series. If your general term is a rational function of \( n \) (like \( n^2/(3n^3+1) \)), the ratio test will almost always give \( l = 1 \). Don’t waste time. Use the comparison test or limit comparison test instead.

Simplification errors with factorials. Remember that \( (n+1)! = (n+1) \cdot n! \). A common mistake is expanding both factorials fully instead of canceling. The whole point of the ratio test is that consecutive terms cancel nicely, so cancel first and take the limit last.

Stopping at the open interval for a power series. When you use the ratio test to find a radius of convergence, it only resolves \( |x| < R \). At the endpoints \( x = \pm R \) the limit equals 1, so you have to test each endpoint separately with another method. Forgetting the endpoints is the single most common slip on power-series questions.

When the Ratio Test Fails

The ratio test is inconclusive when \( l = 1 \). This happens more often than you’d expect, especially with series involving only polynomial terms. When it fails, you need a backup plan. Here are the tests to try, roughly in order of usefulness.

Backup testBest forConvergence rule
Raabe’s testSeries where the ratio test gives \( l = 1 \)Converges if \( \lim n\left(\dfrac{a_n}{a_{n+1}} – 1\right) > 1 \)
Root test (Cauchy)Terms of the form \( f(n)^n \)Converges if \( \lim |a_n|^{1/n} < 1 \)
Limit comparisonRational or polynomial termsCompare against a known p-series
Integral test\( a_n = f(n) \), with \( f \) positive and decreasingConverges if \( \int_1^\infty f(x)\,dx \) converges
Leibniz (alternating)Alternating seriesConverges if terms decrease to 0

Raabe’s test is specifically designed for series where the ratio test gives \( l = 1 \). It looks at the rate at which the ratio approaches 1. If \( \displaystyle \lim_{n \to \infty} n\left(\frac{a_n}{a_{n+1}} – 1\right) > 1 \), the series converges. Raabe’s test picks up exactly where the ratio test leaves off, which is why I always reach for it first in the inconclusive case.

The root test (Cauchy’s test) uses \( \lim_{n \to \infty} |a_n|^{1/n} \) instead of the ratio. It’s strictly stronger than the ratio test in theory (whenever the ratio test concludes, the root test gives the same answer), and it’s particularly handy when the general term has the form \( f(n)^n \).

Comparison tests (direct or limit comparison) work well when you can identify a simpler series that behaves similarly. The limit comparison test was used in Example 3 above to handle the \( x = 1 \) case.

The integral test works when \( a_n = f(n) \) for some positive, decreasing, continuous function \( f \). It converts the convergence question into an improper integral.

For alternating series, the Leibniz test (alternating series test) is usually the right tool. The ratio test works on absolute convergence, so it may miss conditional convergence entirely.

Proof of the Ratio Test

The proof comes in two flavors: a direct argument using geometric series comparison, and a more rigorous version using epsilon reasoning. Both reach the same conclusion, but exam expectations vary. If your course uses Rudin or Bartle, you’ll want the rigorous version. If you’re in a standard calculus course, the first proof is enough.

Convergence Case

From the first part of the statement:

\( \dfrac{u_2}{u_1} < r \), \( \dfrac{u_3}{u_2} < r \), … where \( r < 1 \).

Therefore:

$$u_1 + u_2 + u_3 + \ldots = u_1 \left(1 + \frac{u_2}{u_1} + \frac{u_3}{u_1} + \ldots \right)$$

$$= u_1 \left(1 + \frac{u_2}{u_1} + \frac{u_3}{u_2} \cdot \frac{u_2}{u_1} + \ldots \right)$$

$$< u_1(1 + r + r^2 + \ldots)$$

The right side is a geometric series with ratio \( r < 1 \), so it converges to \( \dfrac{u_1}{1-r} \). Since every partial sum of \( \sum u_n \) is bounded above by a fixed number, the series is convergent. ∎

Divergence Case

Since \( \dfrac{u_{n+1}}{u_n} > 1 \), each term is larger than the previous one:

\( u_2 > u_1 \), \( u_3 > u_2 > u_1 \), \( u_4 > u_3 > u_2 > u_1 \), and so on.

Therefore \( \sum u_n = u_1 + u_2 + u_3 + \ldots + u_n > nu_1 \). By taking \( n \) sufficiently large, \( nu_1 \) exceeds any fixed quantity, so the terms never tend to 0. The series is divergent. ∎

Rigorous Proofs

From the statement of the theorem, it is necessary that \( \forall n: a_n \ne 0 \); otherwise \( \dfrac{a_{n+1}}{a_n} \) is not defined.

Here, \( \left| \dfrac{a_{n+1}}{a_n} \right| \) denotes either the absolute value of \( \dfrac{a_{n+1}}{a_n} \), or the complex modulus of \( \dfrac{a_{n+1}}{a_n} \).

Absolute Convergence

Suppose \( l < 1 \).

Let us take \( \epsilon > 0 \) such that \( l + \epsilon < 1 \).

Then: \( \exists N: \forall n > N: \left| \dfrac{a_n}{a_{n-1}} \right| < l + \epsilon \)

Thus:

$$|a_n| = \left| \frac{a_n}{a_{n-1}} \right| \left| \frac{a_{n-1}}{a_{n-2}} \right| \cdots \left| \frac{a_{N+2}}{a_{N+1}} \right| |a_{N+1}|$$

$$< (l + \epsilon)^{n-N-1} |a_{N+1}|$$

By the Sum of Infinite Geometric Progression, \( \displaystyle \sum_{n=1}^\infty (l + \epsilon)^n \) converges.

So by the corollary to the comparison test, it follows that \( \displaystyle \sum_{n=1}^\infty |a_n| \) converges absolutely. ∎

Divergence

Suppose \( l > 1 \).

Let us take \( \epsilon > 0 \) small enough that \( l – \epsilon > 1 \).

Then, for a sufficiently large \( N \), we have:

$$|a_n| = \left| \frac{a_n}{a_{n-1}} \right| \left| \frac{a_{n-1}}{a_{n-2}} \right| \cdots \left| \frac{a_{N+2}}{a_{N+1}} \right| |a_{N+1}|$$

$$> (l – \epsilon)^{n-N-1} |a_{N+1}|$$

But \( (l – \epsilon)^{n-N-1} |a_{N+1}| \to \infty \) as \( n \to \infty \).

So \( \displaystyle \sum_{n=1}^\infty a_n \) diverges. ∎

Key Definitions

If you’re comfortable with what convergence and divergence mean, skip this section. These definitions are here for reference, particularly if your exam requires formal epsilon-based definitions.

(Definition 1: Convergence) An infinite series \( \sum u_n \), i.e., \( u_1 + u_2 + u_3 + \ldots + u_n \), is said to be convergent if \( S_n \), the sum of its first \( n \) terms, tends to a finite limit \( S \) as \( n \) tends to infinity.

We call \( S \) the sum of the series, and write:

$$S = \lim_{n \to \infty} S_n$$

More precisely, an infinite series \( \sum u_n \) converges to a sum \( S \) if for any given positive number \( \epsilon \), however small, there exists a positive integer \( n_0 \) such that \( |S_n – S| < \epsilon \) for all \( n \ge n_0 \).

(Definition 2: Divergence) If \( S_n \to \pm\infty \) as \( n \to \infty \), the series is said to be divergent. That is, \( \sum u_n \) is divergent if for every given positive number \( \lambda \), however large, there exists a positive integer \( n_0 \) such that \( |S_n| > \lambda \) for all \( n \ge n_0 \).

(Definition 3: Oscillation) If \( S_n \) does not tend to a finite limit, or to plus or minus infinity, the series is called oscillatory. The classic example is \( 1 – 1 + 1 – 1 + \ldots \), whose partial sums alternate between 0 and 1 forever.

A Note on d’Alembert

Jean le Rond d’Alembert (1717 to 1783) was a French mathematician, physicist, and philosopher who co-edited the Encyclopedie with Denis Diderot. He stated this ratio test in 1768, and it was the first ratio test ever given for the convergence of a series. His name shows up across mathematics and physics: d’Alembert’s principle in mechanics, d’Alembert’s formula for the one-dimensional wave equation, and d’Alembert’s paradox in fluid dynamics. So if the name feels familiar from a physics course, that’s why.

Which Resources to Refer?

If you want to study more about this, you can refer to the top analysis books like Rudin, Abbott, and Bartle. Here are the three I recommend most often, in the order I’d hand them to a student.

CLASSIC

Principles of Mathematical Analysis (3rd Edition) by Walter Rudin

700+ ratings
  • The gold standard analysis textbook, known as "Baby Rudin" among math students worldwide
  • Covers real number systems, topology, sequences, continuity, differentiation, and Riemann-Stieltjes integration
  • Includes Dedekind's Cut construction, gamma function section, and 130+ challenging exercises
  • Best for advanced undergraduates and first-year graduate students with proof-writing experience
  • 325 pages, concise and rigorous with no hand-holding
$63.61
Paperback (Int'l Ed.) | Free shipping
The most widely assigned real analysis textbook in university math departments for over 50 years.
#1 BEST SELLER

Understanding Analysis (2nd Edition) by Stephen Abbott

580+ ratings
  • Motivation sections at the start of each chapter explain why each concept matters before the formal treatment
  • Covers sequences, series, continuity, differentiation, integration, and sequences of functions
  • Balances rigorous proofs with readable exposition, ideal for self-study
  • Best first analysis book before tackling Rudin
  • 312 pages with exercises that build proof-writing skills progressively
$49.99
Hardcover | Free shipping
The most readable introduction to real analysis, consistently rated #1 Best Seller in Calculus on Amazon.
BEST FOR BEGINNERS

Introduction to Real Analysis (4th Edition) by Bartle and Sherbert

110+ ratings
  • User-friendly approach that builds from specific cases to general theory, the way math should be taught
  • Covers point-set topology, limsup/liminf, sequences, series, continuity, differentiation, and Riemann integration
  • Includes coverage of Lebesgue Integral and construction of the reals in the 4th edition
  • Suitable for math, economics, engineering, and computer science students
  • Clear proofs with an appendix on logic and proof techniques for those new to formal mathematics
$33.64
Paperback | Hardcover also available
A widely-used undergraduate analysis textbook that teaches deductive thinking across multiple disciplines.

For free my foundation of analysis book is a great place to start.

Frequently Asked Questions

What is D’Alembert’s Ratio Test?

D’Alembert’s ratio test determines whether an infinite series converges or diverges by examining the limit of the ratio of consecutive terms. If the limit is less than 1, the series converges absolutely. If greater than 1, it diverges. If equal to 1, the test is inconclusive and you need a different test like Raabe’s test or the root test.

When does the ratio test fail?

The ratio test is inconclusive when the limit equals 1. This typically happens with series whose general terms are purely polynomial (like 1/n or 1/n²). The harmonic series (divergent) and the series 1/n² (convergent) both give limit = 1, which is why l = 1 means ‘inconclusive,’ not ‘maybe.’ Switch to Raabe’s test, the root test, or comparison tests in these cases.

How do you apply the ratio test step by step?

Write down the general term an. Replace every n with n+1 to get an+1. Form the ratio |an+1/an| and simplify. Compute the limit as n → ∞. If the limit is less than 1, the series converges. If greater than 1, it diverges. If equal to 1, try another test. The key is to simplify the ratio before taking the limit.

What is the alternative form of the ratio test?

Instead of computing lim(an+1/an), you can compute lim(an/an+1). If this limit is greater than 1, the series converges. If less than 1, it diverges. This form is sometimes more convenient because it avoids nested fractions in the calculation.

Why does the proof compare with geometric series?

The geometric series 1 + r + r² + … converges when |r| < 1 and equals 1/(1−r). In the convergence proof, we show that the terms of our series are bounded above by the terms of a convergent geometric series with ratio r < 1. By the comparison test, our series must also converge. The geometric series acts as a known 'benchmark' that we compare against.

What other tests can you use when the ratio test is inconclusive?

When the ratio test gives limit = 1, try Raabe’s test first since it’s specifically built for this situation. The root test (Cauchy) is a good alternative, especially for terms of the form f(n)n. The integral test works when your general term comes from a positive, decreasing function. Comparison tests (direct or limit comparison) are useful when you can identify a simpler series with known behavior. For alternating series, the Leibniz test is usually the right tool.

How is the ratio test different from the root test?

The ratio test uses the limit of |an+1/an|, while the root test uses the limit of |an|^(1/n). The root test is strictly more powerful: whenever the ratio test gives a conclusive answer, the root test gives the same one, but the reverse is not always true. In practice the ratio test is easier when factorials are involved, and the root test is easier when the general term already has the form f(n)n.

Who was Jean le Rond d’Alembert?

Jean le Rond d’Alembert (1717 to 1783) was a French mathematician, physicist, and philosopher who co-edited the Encyclopedie with Denis Diderot. He stated this ratio test in 1768, the first ratio test ever given for series convergence. Other concepts named after him include d’Alembert’s principle in mechanics and d’Alembert’s formula for the wave equation.

Written by

Gaurav Tiwari

WordPress Developer & Content Strategist, CEO · Gatilab · New Delhi, India

18+Years experience
1,215Articles published
4Focus areas

Gaurav Tiwari is a WordPress developer, content marketer, educator, and entrepreneur with 18+ years of hands-on experience building websites, tools, content systems, and growth engines for brands. He is the founder and team lead of Gatilab, where he helps businesses turn slow, confusing websites into fast, clear, conversion-focused platforms. Since 2008, he has published thousands of articles on technology, SEO, blogging, education, business, and web performance, reaching readers who want practical advice without fluff. His work spans WordPress development, search strategy, performance optimization, affiliate marketing, digital publishing, and product-led growth. Gaurav has worked with brands such as IBM, Adobe, HubSpot, Canva, Airtel, Acer, and FreshBooks, while also building education and resource platforms for Indian learners and creators. He writes from experience, mixing technical depth with plain English, honest opinions, and lessons learned from real client work. That blend makes his writing useful for founders, bloggers, students, and independent professionals alike.

WordPress Core Contributor, 18+ years experience, 1100+ client projects

Writes aboutWordPressWeb DevelopmentSEOMarketing

10 comments

Add yours

Leave a Comment

  1. here is D’ Alembert’s ratio test:

    Let Un be the nth term of a positive series such that

    lim Un+1/Un = L

    Then the series is convergent if L 1.
    The test fails to decide the nature of the series if L = 1.

    • When we get the result 1′ we have to work this out with other principle…what did you do when you get the result equal to 1??

    • When the test fails…you have to use raabes test….

  2. Series is convergent if L is less than 1 and divergent if L is greater than 1

  3. It’s nice. Ratio test has so many forms due to which creates confusion. I applied ratio test in this series

    1+ (1/2!)+ (1/3!)+…..
    But I found this series to be divergent using ratio test while this series is convergent.

    • i hate the question having factorial of something in the denominator

  4. Thanks for the brilliant explanation . u enjoyed and understood it better than I got in the lecture