adding counting maximum length of memorized results