How Babbage automated calculations with simple machines