Thx MrShorty.
Surely, that's better approach.

I was just refering to OP's solution explaing it and did some slightly modifications to make it faster.