What were the major factors contributing to improvements in agriculture in the ancient Mesopotamian civilizations?