changed the Matrix to prime type