for loop detection and removed blocks