Add gems. Rewrite test code.