A Generalized Discontinuous Galerkin Method