added checkLoopOuts func