finished c14 and made a faster memoized version