recursion with matrix