Nutrient cycling in agroecosystems