Added loop to main