The Algebra of Invariants