On Gorenstein Algebras