added parameter Memory to getWord