simple variational working i think