Sorry for the late reply!
I implemented the array flip version of the code and seems to work perfectly and suit our needs!
Thanks again for your continued support.