An alternative approach to: https://scratch.mit.edu/projects/799694359/ This one uses lists to try to avoid race conditions between threads.