added array and loop