tested Matrix func