Finished the Loops part