ported some algebra classes