Check in variational code... does not work yet!