Loop planning