Updated toeConstraint to work with parallel processing