In reply to Leonid Batkhan.

Hi Leonid, now the code looks OK. Many thanks!
I hope it could be helpful.

Regards,
Tomasz