Made a loop for various views