New looping method, improved behaviour (no glitch)