Main logic

Now it's working.
Same here, I misunderstood something. It's all good.
Closing comments.