loops on a torus