Thanks a lot! Your solutions have dismissed my problem.

Incidentally I was using your explicit solution earlier, but without the block of code that creates the arrays. Is it the "new" keyword that allocates a new space in memory for these arrays?