got pascal's working, still needs memoization implemented