I did that. 
The logic is insane and I can hardly test it. But this is better.