Adapting the for loop to Chamaleon