added for loop to test.js