adjust variable names and for loop