Replace magic numbers with variables
Rename i variable to cycles