removing loops