The most common reason I have seen for "slow" programs is the dynamically building of arrays. Build Array and Insert Into Array cause memory reallocations, which is a slow process, especially when the arrays get large. Try to initialize the arrays to the needed size and use Replace Array Subset to build up arrays.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5