firstRepeat done thanks to hexagonel