added loopBetween