Changed Cycle from a class to a function.