renamed cons for matrix to ones