Removing loops