LSD: input terms now assumed to be 0/1 not -1/0.