memoization implemented
removes mistake
fixing merges