Repaired flawed loop