Techniques for tying knots