The documentation dictate it is more efficient to preallocate array rather than call append/insert/concatenate.
Based on this, I then prelocate the two variables as