algebra_by, major code simplification