Renamed cycle function into loop