Loop function prototype.