updated polarity to allow constraint between -1 and 1