Memoization of boundaries