Added for loop and array