Automatic looping snippet