Added the array for the bag and for loop