Add variable ordering. TODO: document it.