added sub matrix creation