Egypt began to expand its territory beyond the Nile valley under the rule of what