How do I use the looping function?