Thank you all, and especially Bulat. I've folowed the links and solved the problem in a new way.