Exercise in middle age can prevent memory loss later in life