Greatly improved membership calculation speed

It used to calculate the normalization factor for each element,
whoops!