Efficiency improvement

Soft constraint 4 is now being calculated slightly more efficiently