small change to memorization. need to fix bugs.