Update and rename while_loop to loops