RCDO Main loop