The posted algorithm will create random results depending on the processing order
I cannot see how it creates random results. Can you explain?