Loading arrays using a for loop