Edit too close/too far distance code