Algebra algorithms