Optimizing fertilizer use