High blood sugar tied to memory problems: Study