Setting up the loop