Add both normal/memoize solutions in lua