Move Ring allocation outside the loop
Add reconnections