fucking gradients
vectorized rigidity gradient