My third task with matrix