The waterwheel was perhaps the earliest source of mechanical energy to replace that of humans and animals, and it was first exploited for such tasks as raising water, fulling cloth, and grinding grain into the principal processed food, flour, which fed society right into the modern period.