Added support of matrix generation