modifying the constraint to be more dimentionnal rather than 1D (distance)