I tried to defer the main() loop of the functions but it went a bit wonky. It’s something ill revisit later.
The other problem is that if the user drags a file while the processing is happening all the values on which it was executed will change and these have to be passed to the shell prior to calculation so really there is no benefit (or possible way) to make this work well within the boundaries of a scripting language. Still, this is luxury feature