Improved performance, memoizing results