Work with matrix (example by Romanchik V.)