Add basic looping support