working variational eqns