more intelligent memoizing for specific regression scenario...still needs some debugging