adding note about memoization
first try, doesnt handle blocks properly... gonna try refactoring
working solution