Added 'cycle' function.