IF this script runs too slow, you may want to change the approach from `table.insert(mytable, element)` to `num = num + 1; mytable[num] = element`. It is quite a bit faster, because table.insert always calculates the number of elements (costly), while in the second case you're keeping track of the number yourself. But you need to be consistent and keep the two variables in sync manually.