some rope swinging function