added documentation for setLoops() function