Added comments and a loop for the array creation