Update script version. Change one possibly large array into a while / each loop to save some memory.