more loops replaced