How Hamilton ties a loop knot