changed scripts[i] to scripts.item(i), replaced commented code with a descriptive comment instead