Fighting a bug in the variable-side of the algorithm