Charles Babbage was thirty years old in 1821, as was his close friend, John Herschel, and in English intellectual circles they were both regarded as brilliant mathematicians. One day as Babbage worked in preparing logarithmic tables, a tedious and boring task, he commented to Herschel that he thought he could invent a machine to do these calculations with far more speed and accuracy than a human calculator could. And so was born an idea that would fascinate, tantalize, and absorb him for the remainder of his life. Over the years he drew plans, expanded them, modified them, and finally invented two machines, the Difference Engine and the Analytical Engine. The first was capable only of generating tables, but the Analytical Engine could do much more. It could convert into numbers and print the results of any formula that might be required. It could also develop any analytical formula the laws of whose formation were given. Using punched cards it could store early results in a calculation and then use them to make further calculations when they were required. He had invented the first mechanical computer.