Most early advances in mathematics, astronomy and engineering were byproducts of more immediate and practical goals. Surveying and accounting needs drove ancient Egyptian, Babylonian, Chinese, and Indian mathematics, while calendars created for religious and agricultural purposes drove early astronomy.