Algebraic library ported for Ruby2