update gems, simplify memoization, update specs